<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="ui" uri="http://com.am.tag" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="../common.jsp" %>
<%@ page import="com.system.dao.DoctorDao"%>
<%
	String record_id = request.getParameter("record_id");
	DoctorDao dao = new DoctorDao();
	Map<String,Object> map = dao.getReferralInfo(record_id);
	pageContext.setAttribute("map", map);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>转诊单</title>
     <!-- 插入打印控件 -->
      <OBJECT  ID="jatoolsPrinter" CLASSID="CLSID:B43D3361-D075-4BE2-87FE-057188254255"
                  codebase="jatoolsPrinter.cab#version=8,6,0,0"></OBJECT>  
    
     <script type="text/javascript">
     	function doPrint(how) { 
   			 var myDoc = {
   			 	settings:{paperName:'a5'},   // 选择a4纸张进行打印
   			 	//settings:{orientation:2},   // 选择横向打印,1为纵向，2为横向
   			 	/*settings:{topMargin:100,
		                  leftMargin:100,
		                  bottomMargin:100,
		                  rightMargin:100},   // 设置上下左距页边距为10毫米，注意，单位是 1/10毫米
		        settings:{printer:'OKi5530'},//设置到打印机 'OKi5530'
		        */
        		documents: document,
        		copyrights: '杰创软件拥有版权  www.jatools.com'
   			 }; 
	   		 if (how == '打印预览...') {
	        	 jatoolsPrinter.printPreview(myDoc);} // 打印预览
	    	 else if (how == '打印...') {
	         	jatoolsPrinter.print(myDoc, false); // 打印前弹出打印设置对话框
	         	}
	    	else
	         	jatoolsPrinter.print(myDoc, false); // 不弹出对话框打印
		}
    
    	
    	$().ready(function(){
    		$("#create_time").val(new Date().toLocaleDateString());
    		$("#print_time").val(new Date().toLocaleTimeString());
    	});
    	
    </script>
 </head>
  
  <body style="overflow-x: hidden;overflow-y:hidden;">
  <div style="margin-left:410px;margin-top:10px;">
  	<ui:Permission value="doctor_referral_print">
  		<input type="button" id="surePrint" style="background:url(${path }/images/common/hp_printer.png); width:64px;height:64;border:0" onclick="doPrint('打印...')">
  	</ui:Permission>
  </div>
    <form id="winForm" name="winForm">
    	<input name="referral_id" type="hidden" value="${map['id']}">
			<div id="page1" style="text-align:center;padding-top:30px">
			 	<div>
			 		<span style="font-size:30;font-weight:bold;" >广东技术师范学院门诊部</span><br/>
			 	</div>
			 	<div style="margin-top:5px">
			 		<span style="font-size:30;font-weight:bold;" >转诊单</span><br/>
			 	</div>
			    <div style="margin-top:25px;margin-right:-130px">转诊编号：${map['number']} &nbsp;&nbsp;<input type="text" id="print_time" name="print_time" style="border:0px;vertical-align:middle"></div>
			    <div style="margin-top:15px;margin-right:50px">
					<div style="display:inline;"><span style="font-size:18">${map['class']}${map['name']}</span></div>
					<div style="display:inline;"><span style="font-size:18">同志</span></div>
			    </div>
			   
			    <div style="width:100%;margin-top:10px;margin-right:50px">
			    	<div><span style="font-size:18">患${map['sick']}病</span></div>
			    </div>
			   
			   
			   <div style="width:100%;margin-top:15px;margin-right:50px">
					<div style="display:inline;">
						<span style="font-size:18">
						拟转诊
						<c:choose>
							<c:when test="${map['hospital'] == 0}">华侨医院</c:when>
							<c:when test="${map['hospital'] == 1}">南医三院</c:when>
							<c:when test="${map['hospital'] == 2}">中山三院</c:when>
							<c:when test="${map['hospital'] == 3}">白云区第二医院</c:when>
							<c:when test="${map['hospital'] == 4}">中医药大学第一附属医院</c:when>
							<c:when test="${map['hospital'] == 5}"><input type="text" style="width:150px;BORDER-RIGHT: medium none;BORDER-TOP: medium none;BORDER-LEFT: medium none;BORDER-BOTTOM: rgb(192,192,192) 1px solid;text-align:left;font-size:18;"/></c:when>
						</c:choose>
						${map['subject']}科
						</span>
					</div>
					
						
			   </div>
			  <%--  <div style="width:100%;margin-top:5px;font-size:18px;text-align:center">
			   			${map['subject']}科
			   </div> --%>
			   
				<div style="width:100%;margin-top:35px;margin-left:180px;">
			    	<div ><span style="font-size:18">医生签名:${map['user_name']}</span></div>
			    	
			   </div>
			   
			   <div style="width:100%;margin-top:5px;margin-left:180px;">
			   		<div><input type="text" id="create_time" name="create_time" style="height:30px;width:180px;font-size:18;border:0px;vertical-align:middle"></div>
			   </div>
    			
			</div>	
 	  </form>
  </body>
</html>